{template "nheader.html"}

<script src="{THEME_PATH}admin/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js" type="text/javascript"></script>


<div class="mctable">
    <div class="fileinput fileinput-new mytx" data-provides="fileinput">
        <div class="fileinput-preview thumbnail" id="mytx">
            <img  src="{dr_avatar($member.uid, 0)}">
        </div>
        <div>
            <div class="btn red btn-outline btn-file btn-block">
                <span class="fileinput-new"> 上传 </span>
                <span class="fileinput-exists"> 上传 </span>
                <input type="file" name="...">
            </div>
            <a href="javascript:;" class="btn red fileinput-exists btn-block" data-dismiss="fileinput"> 删除 </a>
            <a href="javascript:dr_save();" class="btn green fileinput-exists btn-block"> 保存 </a>
        </div>
    </div>
</div>
<script type="text/javascript">
    function dr_save() {
        dr_tips('正在上传...', 3, 2);
        var tx = $('#mytx img').attr('src');
        $.post("{dr_member_url('account/upload', array('iajax' => 1))}", {tx: tx}, function(data) {
            if(data == 1) {
                dr_tips('上传成功', 3, 1);
                window.location.reload();
            } else {
                dr_tips('上传失败：'+data);
            }
        });
    }
</script>

{template "nfooter.html"}